#define MIN(x, y) ((x) < (y) ? (x) : (y))

int minCostToMoveChips(int* chips, int chipsSize)
{
    int sum[2] = { 0 };
    for (int i = 0; i < chipsSize; i++) {
        sum[chips[i] % 2]++;
    }
    return MIN(sum[0], sum[1]);
}

void test_minCostToMoveChips(void)
{
    int chips[] = { 1, 2, 3, 4 };
    printf("%d\n", minCostToMoveChips(chips, sizeof(chips) / sizeof(chips[0])));
}